﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Profile;
using System.Data;

using Gift.Model.ENUM;

namespace WebSite.admin.order
{
    public partial class order_add : BaseAdmin
    {

        // Methods
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            string sql = "select * from DB_Member where memberlogin='" + re.replace(this.keyname.Value) + "' and isnull(flag,0)!=2";
            DataTable table = new DataTable();
            table = SQLAccess.GreatDs(sql).Tables[0];
            if (table.Rows.Count > 0)
            {
                foreach (DataRow row in table.Rows)
                {
                    this.user.Items.Add(new ListItem(row["memberlogin"].ToString(), row["memberid"].ToString()));
                }
            }
        }

        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            string str;
            if (this.radio2.Checked)
            {
                str = this.user.SelectedValue.ToString();
            }
            else
            {
                str = "0";
            }
            base.Response.Redirect("order_add01.aspx?memberid=" + str + "");
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                base.ValidateLoginRule(ERule.AddOrder);
            }
        }

      

    }
}